package com.zhaogang.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zhaogang.dto.AdminOrderDto;
import com.zhaogang.dto.GoodsInfoResponse;
import com.zhaogang.dto.OrderInfoResponse;
import com.zhaogang.dto.ReceiptInfoRequest;
import com.zhaogang.dto.SaleOrderManageDTO;
import com.zhaogang.entity.Order;
import com.zhaogang.entity.UserAccount;

public interface OrderMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);
    
    int AddOrder(Order record);//添加订单   熊玉浩写
    
    OrderInfoResponse selectOrderInfo(int id);//查询订单相关信息 何奔
    
    int updateReceiptInfo(ReceiptInfoRequest rir);
    
    int updateValid(int orderId);
    
    int delOrder(int orderId);
    
    GoodsInfoResponse selectSaleGoodsInfo(int saleGoodsId);
    
    

    
    List<SaleOrderManageDTO> querySaleOrderList(@Param(value="saleAccountId")Integer saleAccountId,
    		@Param(value="StartPos")Integer startPos,
			@Param(value="pageSize")Integer pageSize); //分页查询商户所有订单列表
    
    List<SaleOrderManageDTO> querySaleOrderByCon1(@Param(value="saleAccountId")Integer saleAccountId,
    		@Param(value="state")Integer state,@Param(value="goodsName")String goodsName,
    		@Param(value="StartPos")Integer startPos,
			@Param(value="pageSize")Integer pageSize);//分页条件查询商户订单
    
    /**
     * 获取数据数量
     * @return
     */
	int queryCount();
	
	int querySaleOrderCount1(SaleOrderManageDTO saleOrderDto);

	
	/**
	 * 查询所有商家信息
	 */
	List<AdminOrderDto> adminQueryOrder(@Param(value="StartPos")Integer startPos,
			@Param(value="pageSize")Integer pageSize);
	
	/**
	 * 条件查询
	 */
	int queryCount1(@Param(value="id")Integer id,
            @Param(value="realname")String realname,@Param(value="state")String state);
	List<AdminOrderDto> orderQueryByCon(@Param(value="id")Integer id,
			@Param(value="realname")String realname,@Param(value="state")String state
			,@Param(value="StartPos")Integer startPos, @Param(value="pageSize")Integer pageSize);
	
	List<Order> selectUserOrderList(UserAccount user);//查询用户订单信息，秦海元
}